<template>
  <div class="table-case">
    <table class="my-table">
      <slot name="head"></slot>
      <tbody>
        <tr v-for="item in goods" :key="item.id">
          <slot name="body" :id="item.id" :picture="item.picture" :name1="item.name" :tag="item.tag" />
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
export default {
  name: 'TableCase',
  props: {
    goods: {
      type: Array,
      default(){
        return []
      }
    }
  },
  data () {
    return {
      
    }
  }
}
</script>

<style lang="less" scoped>
// 要让我们的代码支持写less，必须先下两个包  npm i less less-loader
// 如果上面下载不下来  就使用  yarn add less less-loader
.table-case {
  width: 1000px;
  margin: 50px auto;
  img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    vertical-align: middle;
  }
}

.my-table {
  width: 100%;
  border-spacing: 0;
  img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    vertical-align: middle;
  }
  th {
    background: #f5f5f5;
    border-bottom: 2px solid #069;
  }
  td {
    border-bottom: 1px dashed #ccc;
  }
  td,
  th {
    text-align: center;
    padding: 10px;
    transition: all .5s;
    &.red {
      color: red;
    }
  }
  .none {
    height: 100px;
    line-height: 100px;
    color: #999;
  }
}
</style>